#include<bits/stdc++.h>

using namespace std;
const int maxn = 1e6 + 500;
map<int, int> M;
bool dp[101];
vector<int> primes;

void init(int n) {
    for (int i = 0; i <= n; i++)dp[i] = true;
    dp[0] = dp[1] = false;
    for (int i = 2; i <= n / i; i++) {
        if (dp[i]) {
            for (int j = 2 * i; j <= n; j += i) {
                dp[j] = false;
            }
        }
    }
    for (int i = 0; i <= n; i++) {
        if (dp[i]) {
            primes.push_back(i);
        }
    }
}

int main() {
    int n;
    cin >> n;
    init(n);
    for (auto p:primes) {
        M[p] = 0;
        for (int t = p; t <= n; t *= p) {
            M[p] += n / t;
        }
    }
    for (auto e:M) {
        cout << e.first << " " << e.second << endl;
    }

    return 0;
}